import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created whit IntelliJ IDEA.
 * Description：
 * User：ZHONGCHEN
 * Date:2022-02-22
 * Time:13:50
 */
public class TestDemo {
    //排序子序列
    /**
     * 牛牛定义排序子序列为一个数组中一段连续的子序列,并且这段子序列是非递增或者非递减排序的。
     * 牛牛有一个长度为n的整数数组A,他现在有一个任务是把数组A分为若干段排序子序列,
     * 牛牛想知道他最少可以把这个数组分为几段排序子序列.
     * 如样例所示,牛牛可以把数组A划分为[1,2,3]和[2,2,1]两个排序子序列,至少需要划分为2个排序子序列,所以输出2
     * 原文链接：https://blog.csdn.net/qq_45915957/article/details/115652047
     *非递减就是a[i]<=a[i+1]，递减就是a[i]>a[i+1]，
     *非递增就是a[i]>=a[i+1]，递增就是a[i]<a[i+1]
     * */
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] num = new int[n];
        for (int i = 0; i < n; i++) {
            num[i] = scanner.nextInt();
        }
        System.out.println(solve(n,num));
    }

    public static int solve(int n, int[] num) {
        int ans = 0;
        int i = 0;
        while (i < num.length) {
           if (i<num.length-1&& num[i]<num[i+1]  ){
               while (i<num.length-1 && num[i]<=num[i+1]){
                   i++;
               }
               ans++;
               i++;
           }else if(i<num.length-1&& num[i] == num[i+1]){
               i++;
           }else {
               while (i<num.length-1 && num[i]>=num[i+1]){
                   i++;
               }
               ans++;
               i++;
           }
        }
        return ans;
    }
    //反转字符串
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
       String s = scanner.nextLine();
        //String s= "I like beijing.";
        String ans =  reverse(s);
        System.out.println(ans);
    }
    public static String reverse(String s){
        String[] ans = s.split(" ");
        StringBuilder ss = new StringBuilder();
        int start = 0;
        int end = ans.length-1;
        while (start < end){
            String tmp = ans[start];
            ans[start]= ans[end];
            ans[end] = tmp;
            start++;
            end--;
        }
        for (String tmp:ans) {
            ss.append(tmp+" ");
        }
        return String.valueOf(ss);
    }

}
